﻿using IService;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;
using WMS.Models;

namespace WMS.Controllers
{
    /// <summary>
    /// 库存查询
    /// </summary>
    public class InventoryInquiryController : Controller
    {
        private readonly IInventoryInquiryService _iiis;
        public InventoryInquiryController(IInventoryInquiryService iiis)
        {
            _iiis = iiis;
        }
        public ActionResult Index()
        {
            return View();
        }
        /// <summary>
        /// 获取出库，库存，总金额,待出库
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> IICAII()
        {
            var result = await _iiis.Inventories();
            if (result != null)
            {
                return this.Success(result);
            }
            else
            {
                return this.Error();
            }
        }
        /// <summary>
        /// 获取产品库存信息
        /// </summary>
        /// <returns></returns>
        [HttpPost]
        public async Task<IActionResult> PIIU()
        {
            var result=await _iiis.ProductInventoryInformation();
            if (result != null)
            {
                return this.Success(result);
            }
            else
            {
                return this.Error();
            }
        }
    }
}
